package me.ingxin.android.sample.lego.activity

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import me.ingxin.android.router.annotaions.Route
import me.ingxin.android.sample.lego.databinding.ActivityTest1Binding
import me.ingxin.android.sample.lego.interceptor.Test4Interceptor

/**
 * Created by ingxin on 2022/4/26
 */
@Route("/activity/test4", interceptorName = ["appGlobal4"], interceptor = [Test4Interceptor::class])
open class Test4Activity : AppCompatActivity() {

    private val binding by lazy { ActivityTest1Binding.inflate(layoutInflater) }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)
        supportActionBar?.title = "/activity/test4"

        val ext1 = intent?.getStringExtra("ext1")

        binding.tvShow.text = "ext1 = $ext1"

        binding.btnBack.setOnClickListener {
            setResult(Activity.RESULT_OK, Intent().apply {
                putExtra("result_key","接收到Test4Activity时间戳${System.currentTimeMillis()}")
            })
            onBackPressed()
        }

    }


}